<?php
/**
 * @author Oliver Leisalu
 * @package DomBankLink
 * @orm tablename bank_payments
 */
class DomBankPayment extends DomBankLinkObject {
	
	
	/**
	* @orm float(7,2)
	*/
	public $price;
	/**
	* @orm char(3)
	*/
	public $currency;
	
	/**
	* @orm char(255)
	*/
	public $description;
	/**
	* @orm char(255)
	*/
	public $clientAccountNr;
	/**
	 * @orm char(255)
	 */
	public $clientName;

	
	/**
	 * Creates new payment object
	 *
	 * @param Float $price
	 * @param String $description
	 * @param String $profile
	 * @return BankPayment
	 */
	public static function createNew( $price, $description, $profile ) {
		$payment = parent::createNew( $profile );
		$payment->price = (float)$price;
		$payment->description = (string)$description;
		
		$link = DomBankLink::getLink( $payment->profile );
		$payment->currency = strtolower( $link->getCurrency() );
		
		return $payment;
	}
	
	
	
	
	
}
?>